import 'package:flutter/services.dart';

class SMSHelper {
  static const MethodChannel _channel =
      MethodChannel('com.zpp.sdzx_manage/file'); // 确保与原生代码中的CHANNEL一致

  static Future<bool> sendSMS(String phoneNumber, String message) async {
    try {
      final bool result = await _channel.invokeMethod(
        'sendSMS',
        {
          'phone': phoneNumber,
          'message': message,
        },
      );
      return result;
    } on PlatformException catch (e) {
      print("Failed to send SMS: '${e.message}'.");
      return false;
    }
  }
}
